﻿using CharacterCreation.Views.Contracts;
using System.Collections.Generic;
using CharacterCreation.Data.Services;

namespace CharacterCreation.Views {
    /// <summary>
    /// The viewmodel 
    /// </summary>
    public class StatisticsHostViewModel : BaseHostViewModel {

        /// <summary>
        /// the statistic views
        /// </summary>
        public List<BaseView> StatisticViews {
            get { return _StatisticViews; }
        }
        private List<BaseView> _StatisticViews = new List<BaseView>() {
            new StrengthView(), new DexterityView(), new FightingView(), new ConstitutionView(),
            new PerceptionView(), new IntelligenceView(), new WillPowerView(), new CharismaView()
        };

        /// <summary>
        /// Gets or sets the SelectedStatisticView
        /// </summary>
        public BaseView SelectedStatisticView {
            get { return _SelectedStatisticView; }
            set {
                _SelectedStatisticView = value;
                if (value != null)
                    this.BaseView.HeaderText = "Statistics - " + _SelectedStatisticView.HeaderText;
                else
                    this.BaseView.HeaderText = "Statistics";
                RaisePropertyChanged("SelectedStatisticView");
            }
        }
        private BaseView _SelectedStatisticView;
                
            
        /// <summary>
        /// constructor
        /// </summary>
        public StatisticsHostViewModel() {
        }

        public override void Export() {
            StrengthService.CreateInstance().Export();
            DexterityService.CreateInstance().Export();
            FightingService.CreateInstance().Export();
            ConstitutionService.CreateInstance().Export();
            PerceptionService.CreateInstance().Export();
            IntelligenceService.CreateInstance().Export();
            WillPowerService.CreateInstance().Export();
            CharismaService.CreateInstance().Export();
        }
    }
}
